home *** CD-ROM | disk | FTP | other *** search
/ My Neighborhood / My Neighborhood.iso / mac / MacFiles / ExitFarm.Dxr / 00037.ls < prev    next >
Encoding:
Text File  |  1997-11-21  |  1.2 KB  |  46 lines

  1. on mouseDown
  2.   global mySprite, snapH, snapV, CastName, exitRequest
  3.   set mySprite to the clickOn
  4.   set startH to the locH of sprite mySprite
  5.   set startV to the locV of sprite mySprite
  6.   set CastName to the name of cast the castNum of sprite mySprite
  7.   set snapped to dragItem(snapH, snapV, 0, 1)
  8.   if not snapped then
  9.     if not (sprite mySprite intersects 5) then
  10.       set NewsnapH to 1
  11.     else
  12.       set NewsnapH to 0
  13.     end if
  14.     if NewsnapH = 0 then
  15.       set the locH of sprite mySprite to startH
  16.       set the locV of sprite mySprite to startV
  17.       updateStage()
  18.     else
  19.       snapTo(mySprite, snapH, snapV)
  20.       set snapped to 1
  21.     end if
  22.   end if
  23.   if snapped then
  24.     if CastName = exitRequest then
  25.       set temp to getOne(wagonList, exitRequest)
  26.       deleteAt(wagonList, temp)
  27.       set temp to getOne(requestLocs, exitRequest)
  28.       setAt(requestLocs, temp, EMPTY)
  29.       puppetSprite(7, 0)
  30.       puppetSprite(8, 0)
  31.       puppetSprite(9, 0)
  32.       puppetSprite(13, 0)
  33.       puppetSprite(14, 0)
  34.       go("Right")
  35.     else
  36.       Talk("Wrong")
  37.       wait(10)
  38.       Talk("i need")
  39.       Talk("S" & exitRequest)
  40.       set the locH of sprite mySprite to startH
  41.       set the locV of sprite mySprite to startV
  42.       updateStage()
  43.     end if
  44.   end if
  45. end
  46.